package com.bitoon.basketdudes.web;

import com.bitoon.web.utils.LocalizedText;
import java.util.List;
import org.apache.log4j.Logger;

public class GuiaJuego extends BaseAction {

    private Logger log = Logger.getLogger(GuiaJuego.class);
    //private static Properties textosGuia = null;
    //private static Properties tipoObjeto = null;
    //private LocalizedText localized = new LocalizedText();

    public GuiaJuego() { 

        /*
        log.debug("Iniciando GuiaJuego");

        String filename = "";

        try {
            if (textosGuia == null) {
                textosGuia = new Properties();
                String lang = (String)session.get("bd_lang");
                filename = "/resources/textosGuiaDelJuego_" + lang + ".xml";
                log.debug(">>> Leyendo " + filename);
                InputStream is = getClass().getResourceAsStream(filename);
                textosGuia.loadFromXML(is);
            }

            // Leer esbd.txt / enbd.txt

            /*
            log.debug("traduccion 1");
            if (tipoObjeto == null) {
                // Abrir fichero y leerlo
                log.debug("traduccion 2");
                log.debug("abriendo esdb.txt");
                filename = "/resources/esdb.txt";
                InputStream is = getClass().getResourceAsStream(filename);
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
                String line;
                while ( (line=br.readLine()) != null) {
                    String[] spliteo = line.split("|");
                    if (spliteo[0].equals("1")) {
                        tipoObjeto.put(br, line)
                    }
                }
            } else {
                log.debug("traduccion 3");
            }
            log.debug("traduccion 4");
             * 
             */

        /*
        } catch (Exception e) {
            log.error("Error al cargar los textos de la guia (filename=" + filename + ")", e);
        }
         *
         */
    }

    public String execute() {
        return SUCCESS;
    }

    /*
    public String getTextoGuiaDelJuego(String key) {
        log.debug(">>>> Pidiendo key: " + key);

        LocalizedText lt = LocalizedText.getInstance();
        return lt.getTextoGuia(key);
    }
     * 
     */

    public String getBaseDatos(String key) {
        return "";
    }

    /*
    public String getLocalizedText(String key) {
        log.debug("en getLocalizedText de GuiaJuego");
        return LocalizedText.getInstance().getTextoGuia(idioma, key);
    }

    public String getLocalizedText(String key, List<String> params, List<String> values) {
        log.debug("en getLocalizedText(key,params,values)");
        return LocalizedText.getInstance().getTextoGuia(idioma, key,params,values);
    }
     * 
     */

}
